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 / concatenate function
Power Apps
Unanswered

concatenate function

(0) ShareShare
ReportReport
Posted on by

Hey,

I have this long code, using concatenate function.

I would like to shorten it, any idea to do so?

Can I add an If statement inside the HTML/concatenate function?

Thanks

Here is the code:

 

/*Concatenate("{LotId:'",FinOpsInput,"',CompanyId:'",CompanyNumber,"',HTML:[ {""htmlTxt"":""",HtmlText2.HtmlText,""",""","linkToProdTable"":","""False","""},{""htmlTxt"":""",QuatationDetailsHtml.HtmlText,HtmlText4.HtmlText,""",""","linkToProdTable"":","""False","""}]}")//PricSpec1.HtmlText
*/
If(
CompanyNumber = "0040",
If(
!IsBlank(
First(
Filter(
fabItems,
Perforation = true
)
)
),
Concatenate(
"{LotId:'",
FinOpsInput,
"',CompanyId:'",
CompanyNumber,
"',HTML:[ {""htmlTxt"":""",
HtmlText2.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
QuatationDetailsHtml.HtmlText,
HtmlText4.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
HTMLperforation.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
Measurement_report.HtmlText,
""",""",
"linkToProdTable"":",
"""True",
"""}]}"
),
Concatenate(
"{LotId:'",
FinOpsInput,
"',CompanyId:'",
CompanyNumber,
"',HTML:[ {""htmlTxt"":""",
HtmlText2.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
QuatationDetailsHtml.HtmlText,
HtmlText4.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
Measurement_report.HtmlText,
""",""",
"linkToProdTable"":",
"""True",
"""}
]}"
)
),
If(
!IsBlank(
First(
Filter(
fabItems,
Perforation = true
)
)
),
Concatenate(
"{LotId:'",
FinOpsInput,
"',CompanyId:'",
CompanyNumber,
"',HTML:[ {""htmlTxt"":""",
HtmlText2.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
QuatationDetailsHtml.HtmlText,
HtmlText4.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
HTMLperforation.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""}]}"
),
Concatenate(
"{LotId:'",
FinOpsInput,
"',CompanyId:'",
CompanyNumber,
"',HTML:[ {""htmlTxt"":""",
HtmlText2.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""},{""htmlTxt"":""",
QuatationDetailsHtml.HtmlText,
HtmlText4.HtmlText,
""",""",
"linkToProdTable"":",
"""False",
"""}
]}"
)
)
)
//{""htmlTxt"":""",HtmlText5.HtmlText,""",""","linkToProdTable"":","""False","""}

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @Volta The first change you could make is to replace First(Filter( with LookUp( which does exactly the same thing in one call.

    Secondly use the With statement to reduce the number of calls to the server.

    Thirdly, you can move the If statement inside the Concatenate and also combine it with &&.

    With({varFabItemFound: !IsBlank(LookUp(fabItems, Perforation = true))},

    Concatenate(.......If(CompanyNumber = "0040" && varFabItemFound,......,)

    )

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

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 139

Last 30 days Overall leaderboard