Create a LOOP in condition in Action

Hi all, 

I need to create a new condition in Action (Only if this condition is true).

The action button will be display only if all the children list is not empty if a variable is over a certain value.

The database is: an Analysis has some risks that have some action to do if the risk has value over 24 (for example). So I need to check if all the risks that have a value over 24, they have almost an action associated.

Can I do this in appsheet or I must use AppsScript?

Thank you so much, best regards!

Solved Solved
0 4 142
1 ACCEPTED SOLUTION

So every Risk that has a value >= 24 must have at least 1 related Action?

ISBLANK( SELECT( [Related Risks][id] , AND( [Value]>=24 , ISBLANK([Related Actions]) ) ) )

View solution in original post

4 REPLIES 4

Huh? Show some examples.

Hi all,

sorry for the delay. I try to explain better:

I have this structure:

Analysis, with many risks, with many actions, example:

Analysis

Analysis IDAnalysis Name
1TestAnalysis

Risk

Risk IDRisk NameAnalysis ID RefValue
1Risk1112
2Risk2126

Action

Action IDAction NameRisk ID Ref
1Action12
2Action22

If one risk has the value >= 24, I must insert some actions.

In the Analysys detail, I can APPROVE this analysis only if all the risks that have value >= 24 have some action.

So, my button APPROVE will be shown only if the condition is TRUE. To do this I need a Condition Loop/For, I think. Is it possibile?

Thank you so much!

Best regards

There is probably an easier way, but from what I understand above, I think you should be able to use an IN and SELECT function to write a condition. Something like this maybe:

IN([_thisRow].[analysis ID], SELECT(Risk[analysis ID ref], AND([Value]>=24, [analysis ID ref]=[_thisRow].[analysis ID ref])))

Making a slice with only risk values above 24 might be a better solution. 

So every Risk that has a value >= 24 must have at least 1 related Action?

ISBLANK( SELECT( [Related Risks][id] , AND( [Value]>=24 , ISBLANK([Related Actions]) ) ) )

Top Labels in this Space