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 / Reference Field in Ano...
Power Apps
Unanswered

Reference Field in Another Form

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I have this code below that doesn't show any errors but it still doesn't work. The color is blue regardless of the condition. I think it is because DVPPRiskColor is a field on a separate form. The formula below is from a SharePoint List called Customer Intake Form while the DVPPRiskColor field is on a form called Analyst Observation. How do I reference this field on the other form so that the colors are appropriately applied? 

 

If(
(LBAnalyst.Text= "Closed" && DVPPRiskColor.Selected.Value = "Green"),
RGBA(76,175, 80, 1),
(LBAnalyst.Text = "Closed" && DVPPRiskColor.Selected.Value = "Yellow"),
RGBA(255, 235, 59, 1),
(LBAnalyst.Text = "Closed" && DVPPRiskColor.Selected.Value = "Red"),
RGBA(211, 47, 47, 1),
RGBA(25, 118, 210, 1)
)

 

 

Categories:
  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @dc0901 

    To reference field across different forms you need to use Variables by using below Expression on the on change of your DVPPRISKColor on your Anyalyst Observation form :



    Set(ColorVar,DVPPRISKColor.Selected.Value)

     Then use the ColorVar on your other form.

     

  • v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@dc0901,

    Based on the issue that you mentioned, do you want to refer to a field value from a form in another screen?

    Could you please tell me that if the DVPPRiskColor will be reset when you refer to it?

    I want to explain to you that if you the DVPPRiskColor is in a form, every time the form submits, the DVPPRiskColor.Selected.Value could not be referred directly.

    I have a test on my side, please take a try as below.

    Set the OnSuccess property of the Form to following:

    Set(CurrentSubmittedRecord, Form1.LastSubmit) /* <- Add this formula */

    Then in your current screen, replace the DVPPRiskColor.Selected.Value to following:

    CurrentSubmittedRecord.ColumnName

    On your side, please modify your formula as below:

    If(
    (LBAnalyst.Text= "Closed" && CurrentSubmittedRecord.ColumnName = "Green"),
    RGBA(76,175, 80, 1),
    (LBAnalyst.Text = "Closed" && CurrentSubmittedRecord.ColumnName = "Yellow"),
    RGBA(255, 235, 59, 1),
    (LBAnalyst.Text = "Closed" && CurrentSubmittedRecord.ColumnName = "Red"),
    RGBA(211, 47, 47, 1),
    RGBA(25, 118, 210, 1)
    )

    Hope it could help you.

    Regards,

    Qi

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found out in testing that I can reference a field on another form that is not contained within the same screen. I tested it by placing a label on my form and then setting its text property to the value on the other screen. However, I still can't make the colors assign properly. One other thing I realized that I didn't mention is that the form on the second screen is in view only mode so I was unable to find the onsuccess property. Here is what I have so far but all of the indicators are blue when I open the screen.

    If(
    LBProjecctStatus.Text = "Closed" && DVPPRiskColor.Selected.Value = "Green",
    RGBA(
    76,
    175,
    80,
    1
    ),
    LBProjecctStatus.Text = "Closed" && DVPPRiskColor.Selected.Value = "Yellow",
    RGBA(
    255,
    235,
    59,
    1
    ),
    LBProjecctStatus.Text = "Closed" && DVPPRiskColor.Selected.Value = "Red",
    RGBA(
    211,
    47,
    47,
    1
    ),
    RGBA(
    25,
    118,
    210,
    1
    )
    )
     

     

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 190 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 135

Last 30 days Overall leaderboard