cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YanivLisha
Regular Visitor

Use user inputs in lookup formula

Hi,

 

I'm Trying to use lookup formula:

LookUpTableFormula , Column)

 

The Column is an input value that I’m getting from the user (like I’m asking “in which column do you wish to look for”).

The user is selecting the value from a dropdown list – which named Week_Period

The value which the user provides is a week period, like the following: 10/25/2020 – 10/31/2020

The required values should be a rate (a number) which matches to this specific Week_Period

 

I set the formula as follow, 

LookUp('Rates',[formula],Week_Period.SelectedText.Value)

 

But the returned value I’m getting is: 10/25/2020 – 10/31/2020

 

 

If I’m using a constant value in the formula like in below I’m getting the correct value:

LookUp('Rates',[formula],’10/25/2020 – 10/31/2020’)

 

Appreciate your help.

 

Thanks,

YanivLisha

4 REPLIES 4
gabibalaban
Super User II
Super User II

@YanivLisha 

I'm afraid that what you want to achieve, dinamically select a column from a list is not possible.

I think you should reconsider your solution and create a column to keep the Week_Period for each record .

 

@gabibalaban thank you for your reply.

I'll need to rethink my data structure in that case.

Hi @YanivLisha ,

If your week period is from a reference list, you could add two extra columns for start and finish date then do something like this

With(
   {
      wDates:
      LookUp(
         YourReferenceList,
         YourPeriodField=YourDropDown.Selected.YourPeriodField
      )
   },
   LookUp(
      YourMainList,
      YourDateField >= wDates.StartDateReference &&
      YourDateField <= wDates.EndDateReference
   )
)

Note that this query will not be Delegable.

 

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.

Hi @YanivLisha ,

Just checking if you got the result you were looking for on this thread. Happy to help further if not.

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.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

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 the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (42,395)