cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

retrieve value from first record in table and store in variable

I seem to be having issues storing record value to variable.  

 

datasource.desired_field=123456789012345

 

varFinalValue should equal "123456789012345" not a table.  

 

Thoughts?

 

set(varFinalValue,Value(datasource.desired_field))

 

datasource: SQL

datatype: varchar(15)

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: retrieve value from first record in table and store in variable

Hi @KUNGFUPANDA559 

 

set(varFinalValue,Value(datasource.desired_field))

will return a table because your are getting all records for data source with column desired_field

 

you can either get first value from collection

set(varFinalValue,Value(First(datasource).desired_field))

 

or lookup data based on condition

set(varFinalValue,Value(Lookup(datasource,condition).desired_field))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

Re: retrieve value from first record in table and store in variable

Hi @KUNGFUPANDA559 

 

set(varFinalValue,Value(datasource.desired_field))

will return a table because your are getting all records for data source with column desired_field

 

you can either get first value from collection

set(varFinalValue,Value(First(datasource).desired_field))

 

or lookup data based on condition

set(varFinalValue,Value(Lookup(datasource,condition).desired_field))

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

 

View solution in original post

Highlighted
Helper II
Helper II

Re: retrieve value from first record in table and store in variable

this is exactly what I was looking for thanks @RezaDorrani 

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (7,467)