Microsoft Vision Scope Detect Face Activity

I am currently testing Detect Face Activity.
I successfully got output as below. Then, How can I extract only “Age” or “Gender” from this result and show them by using [message box] activity?

*** output ****
FaceImage[1]
{
FaceImage
{
Age=34,
Gender=“Male”,
Position=
[{
X=56,Y=169,Width=225,Height=225
}]
}
}


Thank you!

1 Like

@keny

  1. Store above output in one string variable and say ‘Str’.

  2. Then try below expressions to get the required result.

               StrAge = Str.Substring(Str.IndexOf("Age=")+"Age=".Length)).Split(","c)(0)
               StrGender = Str.Substring(Str.IndexOf("Gender=")+"Gender=".Length)).Split(","c)(0)
    

Hi. Thank you for your suggestion. However, It’s still not working correctly… I attached image for out put, and there are assign error as well.
I attache my workflow xaml, so please have a look and give me something… Thank you.

notCorrectMessage


Main.xaml (7.4 KB)

I have tried many times, but still I only got UiPath.MicrosoftVision.FaceImage. Cannot display “age” or “gender” by message box activity…

1 Like

@keny

First try to convert FaceImage type to String and then follow the steps as mentioned in earlier post.

Thats what i have followed already. I still facing same issue

Have to use the for each loop to return each value from the array?

Hi @keny,

You can use this pattern to extract Age and Gender,

Pattern = (Age=\d{2}|Gender=.\w{1,6}.)

Attaching the workflow for your reference. ExtractGenderAge.zip (13.6 KB)

1 Like