Hi,
In my canvas app, I have three Forms. The first two are FormViewer, which display Customer Master and Temporary Customer table. The third Form is an Edit Form, the field will check if the first two FormViewer field is the same, if yes, display the value and not allow to change, if no, empty the input box and ask the user to fill in the correct value.
I would like to ask how to do that?
I have tired to use some like:
If( FormViewer1.Item.'Customer Number' = FormViewer2.Item.'Customer No', DisplayMode.View, Displaymode.Edit)
But I cannot get the value from the FormViewer.
I would like to ask how to get the value from item inside a FormViewer to do comparison>
Thank you very much in advance.
Henry
Hi @SunilPashikanti ,
Thank you very much for your reply.
I tried your method, however, I cannot select FormViewer1.Item in Item property.
I sort of found a solution on this is to name the actual field inside the FormViewer1 and just target that item to compare, it seems work but it's not the best way to get this done.
Henry
Hi @henrychoiyw,
Let’s address how to get the value from an item inside a FormViewer in Power Apps and perform the desired comparison.
Accessing FormViewer Values:
To retrieve the value from a FormViewer, you need to reference the Item property of the FormViewer control.
For example, if you have a FormViewer named FormViewer1, you can access the value of a specific field (e.g., ‘Customer Number’) using FormViewer1.Item.'Customer Number'.
Comparison Logic:
In your case, you want to compare the ‘Customer Number’ field between two FormViewers (FormViewer1 and FormViewer2).
If they match, set the Edit Form’s display mode to View (read-only). Otherwise, allow editing (display mode: Edit).
Formula Adjustment:
The formula you provided is almost correct. However, you need to ensure that the Item property references the correct FormViewer.
Modify your formula as follows:
If(
FormViewer1.Item.'Customer Number' = FormViewer2.Item.'Customer No',
DisplayMode.View,
DisplayMode.Edit
)
Additional Considerations:
Make sure that the field names (‘Customer Number’ and ‘Customer No’) match exactly as they appear in your data source.
Verify that the FormViewer controls are correctly connected to the relevant data sources (Customer Master and Temporary Customer tables).
Apply this adjusted formula to your Edit Form’s DisplayMode property, and it should work as expected.
Solved: Formviewer Get the right data. - Power Platform Community (microsoft.com)
Solved: Display Form Control Getting Your Data - Power Platform Community (microsoft.com)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional