How to selectively show a button based on object relationships

0
 I have a Data grid 2 which has a column with a button on it where people can apply to join the project listed in the data grid 2. The data grid 2 is inside a data view containing the account of the current user (by microflow, if that matters). Is there a way to only make this button visible to people whose accounts are not already associated with the project? So if someone's account is not associated with the project then they will see the button, but if the association is there then they won't see the button. I'm trying to use the conditional visibility settings but I can't work out how to get it to look for one object in a list of objects via association.  Is there an easier way?
asked
2 answers
1

Wrap the button in a dataview with microflow datasource that takes the project as input parameter and returns a user/account. Retrieve the first account that is the current user and is not already associated with the project. Then use conditional visibility to not show the button if the returned object is empty. This way you can also maybe lose the dataview around the grid, as you can use the returned account as input parameter for your button.

Example to retrieve the account in the microflow:

[id = '[%CurrentUser%]']

[not(YourModule.Project_Account = $Project)]

 

answered
0

$currentObject/EC2_new.Project_AccountApplicant != $dataView1

 

This assumes a *-to-1 from Project to Account. Your condition tries to use the contain function which is a string checker. You need to check whether the id at the end of the association is the id of the current account. My answer is how you'd do that in your situation, if my assumption is correct.

answered