cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bdaw32
Level: Powered On

Displaying fields from table on other parts of the canvas

Hey Guys, 

 

New to PowerApps, self-taught using the forums, videos etc. I am building out my first Canvas, and of course it needs to be complex. The user enters in some data as well as selects from existing data. I bundle that up, and send it off VIA Flow to a stored procedure I have onsite. The procedure does it's thing, and returns the results as a 10x10 table. No problems so far, I'm able to see the results after running the procedure and it updates if new values are entered and the procedure is run again.

 

The last critical piece, which I can't find the answers to, is.. how do I display of specific fields in other parts of the canvas? Then I would need to dynamically change the fields based on the position of the slider. I attached a sample file of the results as well as an image of what the canvas would look like to hopefully help bring some clarity. I tried using Data Tables, Galleries but I can't seem to figure out a way of displaying just 1 field within a specific row that alters based on the slider. I was thinking maybe the SQL procedure appends a value to each record, like for row one, the record would be: (1.E)240000 and then I can perform a Lookup for that field (1.E) and parse the results to only display 240000. 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Displaying fields from table on other parts of the canvas

The ID column being returned seems to be an integer.  So change your formula to;

Text(Lookup(Results, ID=2).Sales)

That will use the numeric ID to lookup the row and convert the numeric Sales property to Text.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
6 REPLIES 6
Super User
Super User

Re: Displaying fields from table on other parts of the canvas

When the results are returned store them in a Collection as Records.  Display that collection in the data table.  After that you will be able to access each field in each record in the collection to display it anywhere you like. If you update the record in the collection using Patch the display will update anywhere the values are displayed.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Bdaw32
Level: Powered On

Re: Displaying fields from table on other parts of the canvas


@Pstork1 wrote:

When the results are returned store them in a Collection as Records.  Display that collection in the data table.  After that you will be able to access each field in each record in the collection to display it anywhere you like. If you update the record in the collection using Patch the display will update anywhere the values are displayed.


Thanks for the response. Do you have a formula or a link to a video/another post that demonstrates how I would go about doing that... access each field in each record in the collection to display it anywhere you like?  

Super User
Super User

Re: Displaying fields from table on other parts of the canvas

I don't have a Blog post or video, but here's what you need to produce a sample.

 

  1. Add the following line of code to the OnStart event for the App to create a Collection of Sample data you can use.
    ClearCollect(Collectiondata,{RowID:"1",Column1:"A1",Column2:"B1",Column3:"C1"},{RowID:"2",Column1:"A2",Column2:"B2",Column3:"C2"},{RowID:"3",Column1:"A3",Column2:"B3",Column3:"C3"})
  2. Bind a DateTable to Collectiondata and then select whatever fields you would like to display in the table
  3. Add a number of Text boxes or labels to the screen and use the following formula to display the cell values from the table where RowID is the Table Row and Columnx is the Field value you would like to display
     LookUp(Collectiondata,RowID="2").Column2

If your returned data doesn't include an identifier that can be used in place of RowID just create one yourself when adding the records to the Collection.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Bdaw32
Level: Powered On

Re: Displaying fields from table on other parts of the canvas

You made it seem so simple so I've been trying to figure this out since you responded but I keep running into potholes. Since I'm working with a returned value from flow that's stored as a collection, I figured I would work with that then trying to create a sample data collection. (That wasn't working for me either but I didn't invest too much time trying to figure that one out)

 

Anyways I am getting nothing in the box with a warning:

PowerApps_LookupQuestion.JPG

 

But my field that I'm searching on is a number. Data_Type.JPG

 

 

 

 

Super User
Super User

Re: Displaying fields from table on other parts of the canvas

The ID column being returned seems to be an integer.  So change your formula to;

Text(Lookup(Results, ID=2).Sales)

That will use the numeric ID to lookup the row and convert the numeric Sales property to Text.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Bdaw32
Level: Powered On

Re: Displaying fields from table on other parts of the canvas

Thank you for help, that worked. I wasn't even thinking about that, I should have just walked away and come back to it with a clear head. 

 

Thanks!