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

Simple question which I can't seem to resolve

I'm having a brain lock and can't seem to get this working - that, and the absolutely abysmal performance of PowerApps Studio in general is making me angry.  Anyway, here is the scenario:

 

1. I have a SharePoint list (called "Requests") with a text column called "HoldStatus."

2. When my canvas app loads, I want to populate the value of that column (a TEXT value) into a variable.

 

I've tried Set(varHold, 'Requests'.HoldStatus).  That sets the variable fine, but I cannot apply varHold to any text properties to display the value.  HoldStatus does not have attributes such as Name, Value, etc. available that I can see.

 

What am I doing wrong?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Simple question which I can't seem to resolve

@blanghorst 

Awesome!  So if you did use some code like this wouldn't it get the Status of the current item for you?

Set(varHoldStatus, LookUp('Requests', ID = Value(varID), Status))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

11 REPLIES 11
blanghorst
Level: Powered On

Re: Simple question which I can't seem to resolve

I've also tried ThisItem.holdstatus as well with similar results.

Super User
Super User

Re: Simple question which I can't seem to resolve

@blanghorst
Requests.Holdstatus will return an entire column. You can’t use it in the text property of a label because it’s not text, it’s a column of numbers.

Put this code in the text property of a label to see it’s contents

Concat(Request, Holdstatus & “ “)

Or use this...

Concat(varHold, Holdstatus & “ “)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.
blanghorst
Level: Powered On

Re: Simple question which I can't seem to resolve

Thanks - to be clear, I just want the holdStatus value of the CURRENT item, not the entire column.  I tried "ThisItem.holdstatus" but couldn't quite get it right.

dynamicsedge
Level 8

Re: Simple question which I can't seem to resolve

@blanghorst 

 

Try using a simpler way first and make it more complex later.

 

Try getting it to work with a Gallery then try taking it out later.

 

  1. Put a Gallery and associate it with your data source
  2. Make it show items there
  3. On your text value make it populate with one of your selected Gallery Item's values.

 

Try above and then try it without the gallery. 

You could try it first with the gallery to see if it works like that initially.

Super User
Super User

Re: Simple question which I can't seem to resolve

@blanghorst 

Sure, we can try to do that!  Is the current item found in an Edit Form or a Gallery?  How are you determining current item in general?

Highlighted
blanghorst
Level: Powered On

Re: Simple question which I can't seem to resolve

So, everything resides in a SharePoint list.  We have JSON code in the custom formatting of the Title column which launches the PowerApp and loads the current item.  We are passing a few parameters with the URL as well - yes, I could potentially pass holdStatus but I'd prefer to avoid that if possible.

 

What happens is that if a user presses the "Place on Hold" button, the holdStatus is set to the item's current status and the item's current status is then set to On Hold.   Later, a user can press the "Release Hold" button and I need to set the current status to whatever the holdStatus currently is.  The current status is a choice column, so we set that value via a lookup.  So I need the formula below to work:

 

Set(varSetStatus,LookUp(Choices('Requests'.Status), Value=varHoldStatus))

 

I need varHoldStatus to equal the text value of the current item's holdStatus column and I think the formula above will work.  Ideally, I could just load holdStatus into the varHoldStatus on form load and that should do the trick.

Super User
Super User

Re: Simple question which I can't seem to resolve

@blanghorst 

I'm not seeing any clues here on how you are identifying the record.  Maybe I've missing it in your response.

 

If you are passing URL parameters could you pass in the ID to a LookUp function to get the current status?

Set(myVariable, LookUp('Requests', ID=Param("ID"), Status))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

blanghorst
Level: Powered On

Re: Simple question which I can't seem to resolve

Sorry about that - we are passing the item ID via the URL and in the Item property of the form, have the following formula:

 

LookUp('Requests', ID = Value(varID))

 

 

Super User
Super User

Re: Simple question which I can't seem to resolve

@blanghorst 

Awesome!  So if you did use some code like this wouldn't it get the Status of the current item for you?

Set(varHoldStatus, LookUp('Requests', ID = Value(varID), Status))

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,170)