cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Coopedup
Resolver II
Resolver II

Using a variable in a Patch

Hi,

I'm creating a sequence variable from a ShowColumns / Filter search on a SP list (this is run when a button is pressed, which also navigates a new screen).

 

Set(
        TOSeqNext,
        ShowColumns(Filter(
            'Risk - SPOC',
            Register = "TO"), "Sequence")
        )

 

I want to use this in a Patch, but it keeps given an error that it is a table and not text, number, boolean....how do stop it being a table record but a text string?

Patch('SO&A - Risk Register', Defaults('SO&A - Risk Register'),
    {
    Title: "TO " & TOSeqNext.Sequence,
    'Risk Title': DataCardValue37.Text,
    'Risk Description':DataCardValue38.Text
    }
)

 

Coopedup_0-1645545846553.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@Coopedup 

Yes, your variable is set to a table!

Not exactly sure what it is that you are trying to get to, but you need a value, not a table.

 

If you are trying to get the last sequence number in your variable, then you need to lookup the value.

Example:

Set(TOSeqNext,
    LookUp('Risk - SPOC', Register = "TO", Sequence)
)        

If you have some order to this, then include that as part of your lookup.

Example:

Set(TOSeqNext,
    LookUp(Sort('Risk - SPOC', Sequence, Descending), Register = "TO", Sequence)
)        

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

4 REPLIES 4
Hemzi-fcc
Helper II
Helper II

Try another period on the Sequence to see if it suggests .Value

 

 

Title: "TO " & TOSeqNext.Sequence.Value,

 

 

Edit: i think you can omit the showcolumns, including the sequence column in your filter should return only that columns value.

 

 

Filter(
            'Risk - SPOC',
            Register = "TO", Sequence)

 

RandyHayes
Super User
Super User

@Coopedup 

Yes, your variable is set to a table!

Not exactly sure what it is that you are trying to get to, but you need a value, not a table.

 

If you are trying to get the last sequence number in your variable, then you need to lookup the value.

Example:

Set(TOSeqNext,
    LookUp('Risk - SPOC', Register = "TO", Sequence)
)        

If you have some order to this, then include that as part of your lookup.

Example:

Set(TOSeqNext,
    LookUp(Sort('Risk - SPOC', Sequence, Descending), Register = "TO", Sequence)
)        

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It gives no more suggestions and adding .Value returns another error (Name is invalid)

I couldn't see the route to the value, which is my sequence number. This has worked.

 

Thanks for taking time to look and answer. 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (4,129)