Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

How to understand regex pattern in Power App?

(0) ShareShare
ReportReport
Posted on by

I have a json below:

 

 

 

 

{
	"statusCode": 200,
	"headers": {
		"Transfer-Encoding": "chunked",
		"Vary": "Origin,Accept-Encoding",
		"X-SharePointHealthScore": "1",
		"X-SP-SERVERSTATE": "ReadOnly=0",
		"DATASERVICEVERSION": "3.0",
		"SPClientServiceRequestDuration": "63",
		"SPRequestGuid": "d31336a0-9010-1000-0a20-dcb653f71e16",
		"request-id": "d31336a0-9010-1000-0a20-dcb653f71e16",
		"MS-CV": "oDYT0xCQABAKINy2U/ceFg.0",
		"Strict-Transport-Security": "max-age=31536000,max-age=31536000; includeSubDomains",
		"X-FRAME-OPTIONS": "SAMEORIGIN,DENY",
		"Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com *.powerapps.com *.yammer.com *.officeapps.live.com *.office.com *.stream.azure-test.net *.microsoftstream.com *.dynamics.com *.microsoft.com;",
		"MicrosoftSharePointTeamServices": "16.0.0.22330",
		"X-Content-Type-Options": "nosniff,nosniff",
		"X-MS-InvokeApp": "1; RequireReadOnly",
		"x-ms-request-id": "d31336a0-9010-1000-0a20-dcb653f71e16",
		"Cache-Control": "no-store, max-age=0, private",
		"P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
		"Set-Cookie": "ARRAffinity=b4a5d5fe349f4c875ad3d8ac25e07615025468d24d2831b4f4987af0338dc44a;Path=/;HttpOnly;Secure;Domain=sharepointonline-wus.azconn-wus.p.azurewebsites.net,ARRAffinitySameSite=b4a5d5fe349f4c875ad3d8ac25e07615025468d24d2831b4f4987af0338dc44a;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-wus.azconn-wus.p.azurewebsites.net",
		"X-AspNet-Version": "4.0.30319",
		"X-Powered-By": "ASP.NET",
		"Timing-Allow-Origin": "*",
		"x-ms-apihub-cached-response": "false",
		"x-ms-apihub-obo": "true",
		"Date": "Fri, 22 Apr 2022 02:18:32 GMT",
		"Content-Type": "application/json; odata=verbose; charset=utf-8",
		"Expires": "Thu, 07 Apr 2022 02:18:33 GMT",
		"Last-Modified": "Fri, 22 Apr 2022 02:18:33 GMT",
		"Content-Length": "220103"
	},
	"body": {
		"d": {
			"results": [
				{
					"__metadata": {
						"id": "https://edwarddev365.sharepoint.com/sites/meekou/_api/Web/Lists(guid'6eab758a-a821-4a06-b27d-09dc81dd33bf')/Fields(guid'd307dff3-340f-44a2-9f4b-fbfe1ba07459')",
						"uri": "https://edwarddev365.sharepoint.com/sites/meekou/_api/Web/Lists(guid'6eab758a-a821-4a06-b27d-09dc81dd33bf')/Fields(guid'd307dff3-340f-44a2-9f4b-fbfe1ba07459')",
						"type": "SP.FieldLookup"
					},
					"DescriptionResource": {
						"__deferred": {
							"uri": "https://edwarddev365.sharepoint.com/sites/meekou/_api/Web/Lists(guid'6eab758a-a821-4a06-b27d-09dc81dd33bf')/Fields(guid'd307dff3-340f-44a2-9f4b-fbfe1ba07459')/DescriptionResource"
						}
					},
					"TitleResource": {
						"__deferred": {
							"uri": "https://edwarddev365.sharepoint.com/sites/meekou/_api/Web/Lists(guid'6eab758a-a821-4a06-b27d-09dc81dd33bf')/Fields(guid'd307dff3-340f-44a2-9f4b-fbfe1ba07459')/TitleResource"
						}
					},
					"AutoIndexed": false,
					"CanBeDeleted": false,
					"ClientSideComponentId": "00000000-0000-0000-0000-000000000000",
					"ClientSideComponentProperties": null,
					"ClientValidationFormula": null,
					"ClientValidationMessage": null,
					"CustomFormatter": null,
					"DefaultFormula": null,
					"DefaultValue": null,
					"Description": "",
					"Direction": "none",
					"EnforceUniqueValues": false,
					"EntityPropertyName": "OData__CommentCount",
					"Filterable": true,
					"FromBaseType": false,
					"Group": "自定义栏",
					"Hidden": true,
					"Id": "d307dff3-340f-44a2-9f4b-fbfe1ba07459",
					"Indexed": false,
					"IndexStatus": 0,
					"InternalName": "_CommentCount",
					"IsModern": false,
					"JSLink": "clienttemplates.js",
					"PinnedToFiltersPane": false,
					"ReadOnlyField": true,
					"Required": false,
					"SchemaXml": "<Field ID=\"{d307dff3-340f-44a2-9f4b-fbfe1ba07459}\" Name=\"_CommentCount\" Sealed=\"TRUE\" DisplaceOnUpgrade=\"TRUE\" Hidden=\"TRUE\" ReadOnly=\"TRUE\" ShowInFileDlg=\"FALSE\" Type=\"Lookup\" DisplayName=\"评论计数\" List=\"Docs\" FieldRef=\"ID\" ShowField=\"CommentCount\" JoinColName=\"DoclibRowId\" JoinRowOrdinal=\"0\" JoinType=\"INNER\" SchemaVersion=\"16.0.139.0\" RecreateIfMissing=\"TRUE\" SourceID=\"http://schemas.microsoft.com/sharepoint/v3\" StaticName=\"_CommentCount\" />",
					"Scope": "/sites/meekou/Lists/List1",
					"Sealed": true,
					"ShowInFiltersPane": 0,
					"Sortable": true,
					"StaticName": "_CommentCount",
					"Title": "评论计数",
					"FieldTypeKind": 7,
					"TypeAsString": "Lookup",
					"TypeDisplayName": "查阅项",
					"TypeShortDescription": "查阅项(此网站已有的信息)",
					"ValidationFormula": null,
					"ValidationMessage": null,
					"AllowMultipleValues": false,
					"DependentLookupInternalNames": {
						"__metadata": {
							"type": "Collection(Edm.String)"
						},
						"results": []
					},
					"IsDependentLookup": false,
					"IsRelationship": false,
					"LookupField": "CommentCount",
					"LookupList": "",
					"LookupWebId": "3462638e-632f-4a57-a669-f0b6ce1bcbf2",
					"PrimaryFieldId": "ID",
					"RelationshipDeleteBehavior": 0,
					"UnlimitedLengthInDocumentLibrary": false
				}
			]
		}
	}
}

 

 

I want to get value for `Title`  and `StaticName`, but I fail to make it work with `MATCHALL`

Categories:
  • EdViegas Profile Picture
    436 on at
    Re: How to understand regex pattern in Power App?

     

    First(
     First(
     MatchAll(
     TextInput1.Text,
     "StaticName\"": \""(.*)\"""
     )
     ).SubMatches
    ).Value

     

    If you want to make all together is another price 🤣

  • Meekou Profile Picture
    on at
    Re: How to understand regex pattern in Power App?

    Thanks.

    What is the pattern for getting "Title" and "StaticName"?

    Your code only return "Title".

  • EdViegas Profile Picture
    436 on at
    Re: How to understand regex pattern in Power App?

    I've created a TextInput (named TextInput1) control and put your code in Default property.

     

    Then, I've created a Label and put this code in Text property

     

    First(
     First(
     MatchAll(
     TextInput1.Text,
     "Title\"": \""(.*)\"""
     )
     ).SubMatches
    ).Value

     The result is:

    评论计数

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,026 Most Valuable Professional

Leaderboard