Original Post is here.
I search daily, about new connectors of LogicApps. I also tried to implement Flow. Since it must be a slightly different method than in LogicApps, writing a little code ....
The overall flow will be something like this. The basic flow is almost the same as at LogicApps.
Unlike LogicApps, although Flow is operating on the Azure LogicApps platform, you can not register authoritative applications for that tenant. Judge based on information on Flow site in the connector list It is.
Looking at the source of this site, you can see that a specific class name is set with P tag for the connector.
From the site information, extract the information of P tag where the class name "api - name" is set. We make judgment as connector information from here.
However, there is currently no way to get around this on LogicFlow. Normally, it is possible to extract using regular expressions, perform XML conversion, extract with XPath, etc. However, regular expressions do not exist in functions of LogicFlow, and XML conversion is done on the HTML side Conversion can not be done easily unless it is conscious.
We will create such a function in the Azure Function App. It sends the HTML information of the connector list obtained to the function and returns the result of extracting with the regular expression. These purely functional ones are very suitable for using Function App.
I feel it was okay to return it from Array using Function App, but since I returned it with a string in an old-fashioned way, I converted the result of Function App into an array with split function. Initially, they were separated by (comma) and returned, but since there was a comma in the name as a name in the connector, _ (underscore) is used.
Since the number of elements of the transformed array becomes the number of services provided by Flow, tweet using it.
And after that, it corresponds to the case when newly added.In the last time I was rigidly caring out the process with "whether there is data in Table Storage", but this time it is simple.
We retrieve data from Table Storage, but we explicitly specify key information at this time. If it is a new service, this data acquisition action will "fail", so set the execution condition of the following tweet action as "Failed". By setting like this, the arrow switches to the red dotted line on the designer.
By doing this, you can judge whether it is a new connector without judging whether it was able to acquire it or not. Speaking of one action, it is useful until you think that it will be repeated for the number of services as it is in ForEach, because these methods directly lead to cost reduction.
With this feeling, I tried to detect new connector information of Microsoft Flow.
0 件のコメント:
コメントを投稿