Totally new to PA & almost clueless. However, my basic, simple flow doesn't work and I'm getting an error message which bottom line appears to be saying that the Post to Twitter element is a string, when an array is expected.
I've looked elsewhere to find a similarly simple flow to mine, but that WORKS! It appears to just like mine in it's compilation but I can't see why mine doesn't work.
All help gratefully received.
I've attached a couple of screenshots of the flow, I hope.
Twitter changed their API terms recently. As a result the Twitter connector will no longer function. Because of the change in billing you won't see it get fixed. You can create your own custom connector, but that requires paying for the Twitter connection.
From April 2023, Twitter connector is causing many serious problems.
Read this.
More discussion to be found here; https://powerusers.microsoft.com/t5/Using-Connectors/Twitter-Connection-failed-is-there-something-I-can-do-Or-is/m-p/2141962.
Advise reading it thoroughly.
Hi again. Been working the grey cells hard & have found a solution that works but I need to perform further tests.
I've essentially extracted the body text that I ACTUALLY WANT, leaving out the the links that I don't.
This is the formula which should work whenever there's any number of & any kind of links, provided they are always contained within the bracket ']'.
slice(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),']'),1),add(lastIndexOf(body('Html_to_text'),']'),300))
The figure of 300 is arbitrary and used to encompass the Twitter character limit of 280.
So in words;
Find last record of ']' in the plain text, which will result in a number.
In order for the formula to pick up the last record of ']', 1 has to be added to the result (as far as my analysis tells me!).
Add to this returned number (= character position in text as a number), the arbitrary 300 in order to cover the number of remaining characters for Twitter purposes.
Run the action, which takes out what you want ONLY.
Add Trim action to remove any whitespace before and after the extracted text wanted.
So once the formula performs the action, the remaining desired text is then trimmed for whitespace. See pic.
However, I need to be sure the small boxes between words shown in the raw output result (see pic) aren't going to record in the forwarded text to Twitter.
So I still need to find out how the raw output result (see pic again), presents on Twitter.
I also need to ensure the formula works whether there's an image or not in the body text. If so, I'm in danger of having a truly final resolution for sending Blogger RSS feed blog posts to Twitter, presenting as totally acceptable and as you would naturally want.
Apart from this, I then just have to incorporate the solution into my full working flow. It should also work for a flow which uses the Blog Post as the starting point.
I think that's all....
Fingers are crossed!
Any views etc?
Cheers, Pete
OK. So I've been trying to solve the removal of https image link...and thus far, failing.
I've tried the following formula which works but doesn't do what I want it to, which is;
To find '[' and ']' in the text body and replace with a blank/cleared, but it doesn't work despite being a valid expression.
if(and(startsWith(body('Html_to_text'),'['),endsWith(body('Html_to_text'),']')),'',body('Html_to_text'))
I've looked at some documentation, which suggests that "substitute" text for other would do the job, but I don't see "substitute" as an expression at all.
I think the alternative that I've set up which defines a set number of characters for both the feed "Title" and the "body TEXT" could work if I adopted expression 'slice'. Given the image links (there are always 2 per image) are;
I could use the slice expression for the body text from 0, to the predetermined link characters and cut it out.
This would have to be done twice, for each image link per image, so that just the body text remained.
However, this isn't the preferred flow! The preferred flow being the combined Title and body Text.
Therefore, due to my profound ignorance, I'm once more seeking your advice on how to remove image links between and including the '[' and ']' characters.
Otherwise, the flow I have works perfectly WITHOUT links!! 👌
Eureka! You found the perfect answer to my textual predicament! Excellence indeed 😁.
I now have a perfectly working rss blog feed to Twitter workflow!!! I've done a couple more things to the flow which I'll share in good time BUT....
Whilst this solution works perfectly for blog message posts being auto-forwarded to Twitter, if there's an IMAGE attached, rather included in the blog post, the image link forms part of the TEXT.
Therefore, given the image link is very long, all that is forwarded to Twitter is a truncated image link. See pic.
So now!!!!, I need to remove the entire IMG link in hopefully one step! I'll be looking at the expressions but I ought to check the "community" first, which I should've remembered to do for the Newline hurdle.
However, the Newline answer is embarrassingly simple but fabulously effective, for which I'm overwhelmingly grateful to you for referring and especially the clever soul who had the intellectual wit, to think of it!
Now to the image hurdle.....🙄😕🤞
Take a look at the solution in this thread. (3) Solved: Replace Newline in Flow Expression - Power Platform Community (microsoft.com)
If Char(10) doesn't work that's the next thing to try.
Hi. I'm sorry but I'm not having any joy with your suggestion.
"You can use a replace to search for a char(10) (or char(13))"
I've looked at and tried the string expression for replace but I'm just getting an "invalid" response each time for what I've put into the formula expression.
e.g. replace(variables('Limited characters TOTAL'),char(10),"") where "" = blank (in excel!! but isn't a space of course, which I tried but also doesn't work)
There's clearly coding if not syntax ignorance on my part but I can't get any option I've tried with the 'replace' expression to work.
I've even tried to combine 3 separate 'slices' from the text, attempting to leave out where the \n is kicking in, as taken from the raw input data, but it's not consistent from tests so unsound/unreliable as a workaround, but does work!
So for today, I'm beaten and left wondering how it can be the IFTTT's, Pabbly's, dlvr,it's, Zapier's etc of the world seem to easily get this whole task to work so apparently easily?!
If you're able to offer some clarity and superior wisdom still, I may give it another go but I think it's getting too complicated a flow construction, and what will actually work isn't readily apparent, if even possible, using the free-to-use functions.
Cheers, Pete
Hi. In principle I understand but how to do it, I don't, yet? I looked up \n & clearly it represents starting a new line, or carriage-return. I've had an initial look at the expressions & am not yet finding what may be the potential answer. I've not not found char() yet & if it's a premium use item, I'm scuppered.
However, I'll persevere & yet again, let you know!
Many thanks for the continuing assistance & ear. I'd be lost without it!
😊👍
The \n means that there is a carriage return at that location. You can use a replace to search for a char(10) (or char(13)) to try to get rid of the \n after building your variable and replace it with a space. That may or may not work.
OK, I've looked at the rss feed for the particular test message and there's no carriage-return annotation in the locations which the actual tweet post indicates there are.
I've also looked at the raw INPUTS for the flow and in these particular locations, the annotation of "\n" occurs. This coincides with the place within the text as shown in the full message raw input, where the text is being carriage-returned. See pics.
Just in case, I added an extra stage to the flow which essentially added a second "html cleaner", so hopefully removing any missed html break coding <br> from the rss feed (which there isn't).
Therefore, what's being recorded in the raw input post "window", is what's being forwarded to Twitter, including the unintended carriage-returns the flow process applies!!
I suspect this isn't something easy to overcome. Or is it?
There's always something preventing a truly successful and final solution to this simple flow!
Any ideas?
Cheers, P