Click here to Skip to main content
15,889,861 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working in Power Apps and Power Automate. I have an import file element on my form. When a user imports a file and clicks on the submit button and flow is triggered. I am trying to hide the delete button on the imported file while the flow is running.

What I have tried:

I have tried a JS and no luck.
JavaScript
function showHideFields(executionContext) {

var formContext = executionContext.getFormContext();
var selectionValue = Xrm.Page.getAttribute("digins_rfpdatafile").getValue().fileName;
console.log(XRM.Page.getAttribute("digins_rfpdatafile").getValue().fileName);
if(selectionValue = "True") {
console.log("True "selectionValue);
formContext.getControl("digins_rfpdatafile.fieldControl-file-control-remove-button").setVisible(true);
}
else {
console.log("False "selectionValue);
formContext.getControl("digins_rfpdatafile.fieldControl-file-control-remove-button").setVisible(false);
}
Posted
Updated 15-Feb-24 4:49am
v2

1 solution

You should be able to do that using the UpdateContext function to create a context variable that tracks the status of the flow.

In the OnSelect property of your Submit button:
YAML
UpdateContext({conFlowComplete: YourFlow.Run(parameters).Success})

The result of the flow gets assigned to conFlowComplete.

In the DisplayMode property of your button:
YAML
If(conFlowComplete = "Yes", DisplayMode.Edit, DisplayMode.Disabled)

This will disable the button if the flow has been triggered correctly.
 
Share this answer
 
Comments
Computer Wiz99 19-Feb-24 21:16pm    
I can not make those changes to the Submit button. Is there another way?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900