Your cider was flat when you drank it because it lost much of its CO2 when you were transferring it from the keg to the bottle, as evidenced by the foam.
The gold standard for filling bottles from a keg without losing carbonation is a counter-pressure filler, which pressurizes the bottle with CO2 before filling it with beer, so that the CO2 stays in solution. That's an equipment investment you'd want to make if you're commonly bottling entire batches or large portions thereof.
To fill bottles without a counter-pressure filler, first make sure your draft lines are balanced. If you can pour a pint from the tap without excessive foam, then you can consider filling a bottle from that tap. If not, then you need to either chill your keg and reduce the pressure to balance it with the resistance of your draft lines, or use longer lines (not really practical for 35 psi).
Once your draft lines are balanced, you'll need to be a little more careful when filling a bottle as opposed to a pint glass. A growler filler or even a length of 1/2" inner diameter tubing slipped over the tap will help you fill the bottle smoothly, minimizing the amount of carbonation lost to agitation. Fill the bottle as near to the top as you can, and cap it tightly and quickly. It should hold carbonation like that for a week or so.
Addendum on "balance"
Having your draft lines balanced means they provide resistance to match the pressure in the keg, so that the beer/cider pours slowly and smoothly. There are many questions on this site on the topic of balance and line length. Here's some additional reading that will walk you through the calculations behind it: https://www.kegworks.com/blog/determine-right-pressure-for-your-draft-beer-system/
At 35psi, you'd need about 50ft of 1/4" vinyl tube to provide enough resistance. Your valve might be able to make up for a shorter length of tubing, but the turbulence around a partially open valve can also cause CO2 to come out of solution and create foam.
Since colder liquids absorb CO2 more effectively, you can get the same volume in solution at a lower PSI. That's why I recommend chilling your cider and reducing the pressure, so that you can get it out of the keg with a more reasonable amount of tubing. This could also help if your cider truly hasn't carbonated properly yet, and it's not just CO2 loss during bottling.