cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

Filter a form view from output from another form view

Hey Everyone,

 

I'm getting stumped on this one and would appriciate your help... I am trying to have a form view display data using a key in another form view.

 

Basically I have a sharepoint gallery app that is to record lines for delivery scans. When a driver goes to look at the scan history I would like for him to see the details of the order pulled from NAV.

When I set the second form viewer to "First(Sales_Shipment_Compare)" I do get the first result as expected. However, I would like to display the information related to the actual packing slip in question. Below I have a screenshot of the two fields that I would like to link.

 

The top one is the source from the gallery control, the second is what I would like to populate based on the first. Thanks for your help in advance!

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

OK, from what you just shared, your "No" is a field in your "Sales_Shipment_Compare" datasource, and you need to match it to the Scan number you mentioned. In that case, you don't want:

'Packing Slip Number_DataCard1'.DataField

 

...that will just get you the column name of the field from that datasource. You want to reference the actual control name that houses the information.

 

For instance, if I have an employee form with a "Phone" datacard, and then outside the form I add a text input and set the default value to be:

Phone_DataCard1.DataField

...I will get cr6c6_EmployeePhone... NOT the phone number I was looking for.

 

I need to instead reference the actual control housing the information:

DataCardValue24

...which gives me the phone number.

 

Add a text input to your screen and set its Default property to be 'Packing Slip Number_DataCard1'.DataField and you will see what I mean.

View solution in original post

Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

Add ".Text" to your DataCardValue1...

 

First(Filter(Sales_Shipment_Compare, No = DataCardValue1.Text))

View solution in original post

7 REPLIES 7
Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

This is fairly straightforward, but to be specific, you're goint to have to provide more data on your setup.

 

In general, if you are trying to populate a single datapoint (like a text input or label) from a datasource based on the information in another item on your screen, you will want either:

LookUp(yourSource, [your condition statement]).yourField

--or--

First(Filter(yourSource, [your condition statement])).yourField

 

If you are trying populate a list (or gallery) of items based on the information in another item on your screen, you will want:

Filter(yourSource, [your condition statement])

 

In any of those instances, it is the [your condition statement] where you would create the linkage between the two fields. For instance:

yourNAVPackingSlipNumber = yourSCANPackingSlipNumber

 

I apologize if that is all already known to you and you're actually looking for help on a different part, but you left so much unsaid about your setup that I figured I'd better start at the beginning.

Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

And, I should add if you are looking to populate a form, use:

 

First(Filter(yourSource, [your condition statement]))

...in the Item property.

Highlighted
New Member

Re: Filter a form view from output from another form view

Thanks for getting back to me, I appriciate the clarification on the basics for sure. 

 

It's some of the syntax of the condition statement I don't think I'm getting, but to clarify...

 

Right now I have:

First(Filter(Sales_Shipment_Compare, No = 'Packing Slip Number_DataCard1'.DataField))

 

Sales shipment compare is the name of the NAV datasource.

 

This doesn't spit back any errors, however it isn't pulling up any data in the form.

Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

OK, from what you just shared, your "No" is a field in your "Sales_Shipment_Compare" datasource, and you need to match it to the Scan number you mentioned. In that case, you don't want:

'Packing Slip Number_DataCard1'.DataField

 

...that will just get you the column name of the field from that datasource. You want to reference the actual control name that houses the information.

 

For instance, if I have an employee form with a "Phone" datacard, and then outside the form I add a text input and set the default value to be:

Phone_DataCard1.DataField

...I will get cr6c6_EmployeePhone... NOT the phone number I was looking for.

 

I need to instead reference the actual control housing the information:

DataCardValue24

...which gives me the phone number.

 

Add a text input to your screen and set its Default property to be 'Packing Slip Number_DataCard1'.DataField and you will see what I mean.

View solution in original post

Highlighted
New Member

Re: Filter a form view from output from another form view

Makes Sense, don't know why I thought I couldnt do that.

 

Now I have:

First(Filter(Sales_Shipment_Compare, No = DataCardValue1))

 

But it's returning invalid argument type. 

Highlighted
Solution Sage
Solution Sage

Re: Filter a form view from output from another form view

Add ".Text" to your DataCardValue1...

 

First(Filter(Sales_Shipment_Compare, No = DataCardValue1.Text))

View solution in original post

Highlighted
New Member

Re: Filter a form view from output from another form view

That was it! Thanks a bunch!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,797)