Hi All,
I'm building an app to control a number of Power Automate Flows that perform various functions to SharePoint.
I am using the "respond to PowerApps" at the end fo the flows to return messages and status of the functions performed.
One flow in particular (which checks for the existance of a SharePoint site) responds with "siteexists" = "true/false" which is captured in the power app variable FlowResponse.siteexists.
I can see that the value for FlowResponse.siteexists is being correctly updated (I've set a label to display the value).
Where I run into problems is that if the site exists, I need to disable the button that kicks off the flow to "Create a Site".
I've tried to achieve this by changing the DisplayMode of the "Create a Site" button like this:
If(FlowResponse.siteexists = "true", DisplayMode.Disabled, DisplayMode.Edit)
The button however does not change display mode even though I can see the value of FlowResponse.siteexists is changing.
Any help would be greatly appreciated, thanks
Solved! Go to Solution.
Thanks @JP_Verolme and @NandiniBhagya20 for your responses.
I kept trying to find a way to make it work... I did try the boolean suggestion, it didn't work at first, so I went back to using a text value in the response from power automate and eventually (re-typing/changing it for the 20th time) I used "True" instead of "true" in the If statement... problem solved... who knew it was case sensitive! It works perfectly now
This is the working statement:
If(FlowResponse.siteexists = "True", DisplayMode.Disabled, DisplayMode.Edit)
On App Start property you can call the flow which you have created -
Set(varsiteexists, FlowResponse.Run().siteexists)
Then in DisplayMode property of button control you can use -
If(varsiteexists = "true" || varsiteexists, DisplayMode.Disabled, DisplayMode.Edit)
Hi @gjme ,
Could you give this a try?
If(FlowResponse.siteexists, DisplayMode.Disabled, DisplayMode.Edit)
I'm not sure, but if you want to use 'true' als a boolean value, you need to use it without the quotes, because then it is seen as a text value.
Furthermore, we can remove the equation part, because the 'If' statement checks wether a statement is true.
Because 'FlowResponse.siteexists' has the value 'true' (or false) the output is already a boolean value, so there is no need to use '= true'.
I hope this is helpful for you. If so, please click on the Thumbs Up below and Accept it as the solution, so this could be helpful to others with the same problem.
Kind regards, Jan-Pieter
Thanks @JP_Verolme and @NandiniBhagya20 for your responses.
I kept trying to find a way to make it work... I did try the boolean suggestion, it didn't work at first, so I went back to using a text value in the response from power automate and eventually (re-typing/changing it for the 20th time) I used "True" instead of "true" in the If statement... problem solved... who knew it was case sensitive! It works perfectly now
This is the working statement:
If(FlowResponse.siteexists = "True", DisplayMode.Disabled, DisplayMode.Edit)
how you trigger the flow in first place?
Do you have a button what trigger it or it's trigger from Power Automate trigger?
I've got several buttons that each start a different flow (different use cases)..but I needed to be able to turn the buttons on / off based on the results of other flows. For example, CreateDocumentLibrary needed to be "off" until the CheckSiteExists flow had returned a positive result.
In the OnSelect property of the button I have the following generic statement:
Set(varFlowResponse, FlowName.Run(vars...))
Change OnSelect of the button to
IF(Set(varFlowResponse, FlowName.Run(vars...).siteexists)= "True",Set(varSiteE, true),Set(varSiteE, false))
Or try this one
Set(varFlowResponse, FlowName.Run(vars...);
If(varFlowResponse.siteexists = "True",Set(varSiteE, true),Set(varSiteE, false))
To all buttons place
IF(varSiteE, DisplayMode.Edit,DisplayMode.Disabled)
on Screen OnVisible property place
Set(varSiteE, false)
Check the above I edit it one of above in OnSelect should work
User | Count |
---|---|
253 | |
113 | |
92 | |
48 | |
38 |