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

how to retrieve 2 different column in one item in sharepoint

Hi,

I've create powerapps form and connect it sharepoint online. 

 

in powerapps, how can i retrieve submitted item in sharepoint online, but I want to retrieve 2 different column?

I want to read 2 column from the same item.

 

Lets say this is sharepoint online:

example1.PNG

 

I want to retrieve Sarah info and her date must be more than 2/20/2019.

If Sarah date is less than 2/20/2019, then the system will not show any info.

So i do on a button:

LookUp('Student', Name="Sarah") 

 

My question, how can continue the code to retrieve the Sarah's date (2/22/2019) either her date is more or less than 2/20/2019?

 

I can't do this, because the date is random from date's column,  not  sarah's date.
LookUp('Student', Name="Sarah" && Date > 2/22/2019) 

6 REPLIES 6
Super User
Super User

Re: how to retrieve 2 different column in one item in sharepoint

@shabila97 

Not sure I understand that the Date column is "random".  What are you trying to say here?

Your formula you have will work against your case statement.

 

I want to retrieve Sarah info and her date must be more than 2/20/2019.

If Sarah date is less than 2/20/2019, then the system will not show any info.


Your lookup formula will satisify this case (with a slight modification):

   LookUp('Student', Name="Sarah" && Date > DateValue("2/22/2019"))

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
shabila97
Level: Powered On

Re: how to retrieve 2 different column in one item in sharepoint

How if, I want to compare random student's date from today?

 

In powerapps, there is a textbox for user to enter a name. Lets say user enter "Sarah" then system will find Sarah's date and compare the date with today().

 

If(LookUp(MySPList, "Name" = DataCardValue1), Navigate(Screen 1, None)

here I want to look up another column "date" of the lookup "name" how shoud i do?

 

Super User
Super User

Re: how to retrieve 2 different column in one item in sharepoint

@shabila97 

So, if you have a Textbox which you are using to find the name, why not a DatePicker to choose the date?

Or to put it together in your formula:

 

  If(!IsBlank(Lookup('Student', Name=TextBox1.Text && Date >= DatePicker.SelectedDate).ID), Navigate(Screen1, None))

 

That would navigate you to screen1 if it successfully finds an item that matches the name supplied in the TextBox and the Date >= the value chosen in the DatePicker.

 

Hope this gives you more to go on.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
shabila97
Level: Powered On

Re: how to retrieve 2 different column in one item in sharepoint

Hi  RandyHayes


If(!IsBlank(Lookup('Student', Name=TextBox1.Text && Date >= DatePicker.SelectedDate).ID), Navigate(Screen1, None))

On the highlighted code above, how if I use a label and set the default value toText(DateAdd(Now()) instead of using a date picker? How could I replace the code? Apologise, i still a beginner to powerapps 

 

Community Support Team
Community Support Team

Re: how to retrieve 2 different column in one item in sharepoint

Hi @shabila97 ,

If you use a Label control to display today's date, and want to compare it with the Date column value within your SP list, I have made a test on my side, please take a try with the following workaround:

Set the Text property of the Label control (Label1) to following:

 

Text(DateAdd(Now(),2))

Set the OnSelect property of the Button control to following (modify your formula as below):

 

If(
!IsBlank(
Lookup('Student', Name = TextBox1.Text && Value(Text(Date, "[$-en-US]yyyymmdd")) >= Value(Text(DateValue(Label1.Text), "[$-en-US]yyyymmdd"))).ID /* <-- Date represents the Date column in your SP list */
),
Navigate(Screen1, None)
)

Or

If(
!IsBlank(
Lookup('Student', Name = TextBox1.Text && Value(Text(Date, "[$-en-US]yyyymmdd")) >= Value(Text(DateValue(Label1.Text), "[$-en-US]yyyymmdd")))
),
Navigate(Screen1, None)
)

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: how to retrieve 2 different column in one item in sharepoint

@shabila97 

No problem...

 

I am a little confused in that you seemed to indicate that you wanted the users to be able to choose dates.

However, if you have a label with a date string in it, then you can just convert it to a value for your filter. 

 

If(!IsBlank(Lookup('Student', Name=TextBox1.Text && Date >= DateValue(yourlabelName.Text)).ID), Navigate(Screen1, None))
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 43 members 4,967 guests
Please welcome our newest community members: