web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using a variable in a ...
Power Apps
Answered

Using a variable in a Patch

(0) ShareShare
ReportReport
Posted on by 355

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

 

Categories:
  • Hemzi-fcc Profile Picture
    105 on at

    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)

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @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.

  • Coopedup Profile Picture
    355 on at

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

  • Coopedup Profile Picture
    355 on at

    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. 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard