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

Community site session details

Session Id : qVYHgvYi4b5ItJo13PaKMI
Power Apps - Building Power Apps
Answered

How do get record data outside of a form?

Like (0) ShareShare
ReportReport
Posted on 12 Feb 2024 02:25:29 by 825 Moderator

I have a form that gets populated with a gallery selection. This all works great. What I want to be able to do is show the data populated in two of the data cards outside of the form in labels. How do I do this?

 

More detail

The form is showing the end user marketing campaign information. The two data cards in question contain a URL and campaign name. Both these values are used by the end user. They copy and paste them into their marketing platforms. My initial thought to make the process easy was to add a button or icon and use the Copy() function to grab the data. The problem is that the form is in view mode unless they hit the edit button. Because the form is in view mode you can't click any buttons in the form. Toggling the form to edit mode just to click a copy button is not user friendly. The idea is grab this data and put(copy) it outside of the form so they can use a copy button at all times.

Categories:
  • AARON_C Profile Picture
    2,233 Most Valuable Professional on 12 Feb 2024 at 23:38:03
    Re: How do get record data outside of a form?

    @futr_vision 

     

    Yes, that would also work. That shows in the Label as soon as the gallery is selected. The Copy function also saves the text to your clipboard.

     

    I thought you wanted it to show in the labels when the copy button is pressed (my first post).

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

     

  • Verified answer
    futr_vision Profile Picture
    825 Moderator on 12 Feb 2024 at 21:31:52
    Re: How do get record data outside of a form?

    @AARON_C 

    Thanks. I'm not setting the form with the gallery at all using OnSelect. I am setting the Items property of the form to Gallery.Selected. 

     

    This solution actually gave me an idea to try something. Instead of fiddling with the form why not us the OnSelect of the gallery item to set the variable like this:

     

    UpdateContext({varFullURL: ThisItem.'Full URL'})

     

    This seems to work well. It populates whenever a gallery item is selected. Then I can add a copy icon/button and add this code its OnSelect:

     

    Copy(varFullURL)

     

    See any drawbacks to this approach?

  • Verified answer
    AARON_C Profile Picture
    2,233 Most Valuable Professional on 12 Feb 2024 at 02:44:43
    Re: How do get record data outside of a form?

    Hi @futr_vision 

     

    I assume you currently populate your form by doing something like in the OnSelect property of the gallery:

     

    Set(varRecord, ThisItem);

     

     

    Then the Items property of your form you have: 

     

    varRecord

     

     

    To copy data from the form (in view mode) using a button, create a new variable in the OnSelect property of the button:

     

    Set(varRecordURL, varRecord.URL);

     

     

    Then for your label control Text property:

     

    varRecordURL

     

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2

Loading complete